import axios from "axios";

export const jyInstance = axios.create({
    timeout: 20000,
});
jyInstance.interceptors.request.use(
    function (config) {
        !config.data && (config.data = {});
        localStorage.getItem("access_token") && (config.headers.Authorization = "Bearer " + localStorage.getItem("access_token"));
        return config;
    },
    function (error) {
        return Promise.reject(error);
    }
);
jyInstance.interceptors.response.use(
    function (response) {
        return response;
    },
    function (error) {
        return Promise.reject(error);
    }
);
